<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
    
        a();                       // 2
        var a = function() {
            alert(1);
        }
        a();                       //  1
        function a() {
            alert(2);
        }
        a();                       //  1
        var a = function() {
            alert(3);
        }
        a();                       // 3


        /*
        1.定义
            function a() {alert(2);}
        2.执行
            a();    //2
            a = function() {alert(1);}
            a();    //1
            a();    //1
            a = function() {alert(3);}
            a();    //3
        
        */
    
    </script>
</body>
</html>